<template>
  <div style="height: 100vh;">
    <!--头部-->
    <van-nav-bar
        title="开设院校"
        left-text="返回"
        left-arrow
        @click-left="backBtn"
    />
    <!--简介-->
    <div class="info">
      <span style="color: #aaa;font-size: 15px" v-if="cateFlag === 0">学术硕士</span>
      <span style="color: #aaa;font-size: 15px" v-else>专业硕士</span>
    </div>
    <van-divider
        :style="{ color: '#333', borderColor: '#333'}"
    />
    <!--院校列表-->
    <div class="universityList">
      <van-cell-group inset>
        <van-cell :title="item.name" v-for="item in universityList" :key="item.id" @click="toUniversityDetail"/>
      </van-cell-group>
    </div>

  </div>
</template>

<script>
export default {
  name: "OpenUniversity",
  props: ['cateFlag','majorId'],
  data() {
    return {
      universityList:[]
    }
  },
  methods: {
    //去院校详情页
    toUniversityDetail(){
      console.log(1111)
    },

    backBtn() {
      this.$router.back()
    },
  },
  created() {
    this.request.get('/api/university/queryUniversityListByMajorId',{
      params:{
        majorId:this.majorId
      }
    }).then(res => {
      if (res.code === 1){
        this.universityList = res.data ? res.data : []
      }
    })
  }
}
</script>

<style lang="less" scoped>
.universityList {

}

.info {
  height: 25px;
  display: flex;
  flex-direction: column;
  margin-left: 8%;
  margin-top: 15px;

  b {
    font-size: 15px;
  }
}
</style>